package com.example.homelicaisystem.services.impl;

import com.example.homelicaisystem.dao.MyAssetMapper;
import com.example.homelicaisystem.entity.Investment;
import com.example.homelicaisystem.entity.MyAsset;
import com.example.homelicaisystem.services.MyAssetService;
import com.example.homelicaisystem.utils.UserUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class MyAssetImpl implements MyAssetService {
private final MyAssetMapper myAssetMapper;

    public MyAssetImpl(MyAssetMapper myAssetMapper) {
        this.myAssetMapper = myAssetMapper;
    }

    @Override
    public List<MyAsset> getListCard() {
        int userId = UserUtil.getUserId();
        return myAssetMapper.getListCard(userId);

    }

    @Override
    public List<Investment> getListInvestment() {
        int userId = UserUtil.getUserId();
        return myAssetMapper.getListInvestment(userId);
    }
}
